home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: What is &Variable (declared as: char Var
- Date: 28 Feb 1996 06:51:00 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb27235100@qcd.lanl.gov>
- References: <13b_9602272020@amphigory.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Pazuzu@amphigory.com's message of 27 Feb 96 20:16:46
-
- In article <13b_9602272020@amphigory.com>
- Pazuzu@amphigory.com (Pazuzu) writes:
-
-
- P: > char myarray[10];
- <snip>
- P: myarray may not be a pointer (actually, it IS, but for the sake of
- argument...)
-
- This statement is wrong, read the FAQ. (Sorry, I am tired of
- explaining this already ... look at my other posts in this thread.)
-
- P: but EVERYTHING, EVERYTHING, EVERYTHING has a memory address (otheriwise, it
- P: ain't in memory!), and &<identifier> gives you its address. myarray IS a
- P: pointer. All arrays are pointers.
-
- The last statement is completely incorrect. The emphasized EVERYTHING
- ought to be qualified: (i+j) never has an address, neither does k
- after `register int k'
-
- <snip>
- P: Yes, you can pass it. here:
- P:
- P: void func1(char *blort) {
- P: printf("%s", blort);
- P: }
- P:
- P: void func2(void) {
- P: char astring[81];
- P: strcpy(astring, "this is a test...");
- P: func1(&astring);
- P: }
-
- A C compiler which compiles this without diagnostic is not a
- conformant C compiler: the code as written is invalid C.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-